package com.xintoucloud.gsv.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xintoucloud.gsv.model.DataGrid;
import com.xintoucloud.gsv.model.SuperVisionDto;
import com.xintoucloud.gsv.service.SuperVisionService;

/**
 * @author XXQ
 *
 */
@Controller
public class DepartmentPeraonnelController {
	
	@Autowired
	private SuperVisionService superVisionService;
	
	@RequestMapping("/departmentPeraonnel")
	public String departmentPeraonnel() {
		return "departmentperaonnel";		
	}
	
	@RequestMapping("/selectDepartment")
	public void selectDepartment(String dname) {
		superVisionService.selectDepartment(dname);
	}
	
	
	@RequestMapping("/listShowSuperVisionWaitRegister")
	@ResponseBody
	public DataGrid<SuperVisionDto> showSuperVisionWaitRegister(HttpServletRequest request) {
		//1.获取参数
		 String page = request.getParameter("page");// 获取当前页 
		 String size = request.getParameter("limit");// 获取每页信息显示的条数 
		 //2.数据库执行分页操作
		DataGrid<SuperVisionDto> superVisions=superVisionService.listPage(Integer.parseInt(page), Integer.parseInt(size));
		return superVisions;
	}
	

}
